home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 October / EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso / Aminet / comm / mail / thor201.lha / THOR_2.0 / InstallThor < prev    next >
Text File  |  1995-05-15  |  15KB  |  608 lines

  1. ;*************************************************************************
  2. ;    Title:
  3. ;        InstallThor
  4. ;*************************************************************************
  5. ;    Description:
  6. ;        Commodore Installer Script for the Thor 2.0 software
  7. ;*************************************************************************
  8. ;    Author:
  9. ;        Øyvind Ellefsen - versions for THOR upto 1.22
  10. ;       Petter Nilsen   - versions for 1.25 ->
  11. ;*************************************************************************
  12. ;    Still to do:
  13. ;        - Show .readme file
  14. ;        - Warn against MultiUser
  15. ;
  16. ;*************************************************************************
  17. ;
  18. ;******************************************************
  19. ;***** SET UP OUR VARIABLES AND OTHER SUCH STUFF ******
  20. ;******************************************************
  21.  
  22. ; some useful variables
  23.     (set true 1)
  24.     (set false 0)
  25.     (set yes true)
  26.     (set no false)
  27.     (set is_a_file 1)
  28.     (set is_a_dir 2)
  29.     (set quote "\"")
  30.     (set newline "\n")
  31.     (set nothing "")
  32.  
  33. ; set up our delete options
  34.     (delopts "AskUser" "OkNoDelete" "Force")
  35.  
  36. ; some useful procedures
  37.     ; change userlevel to expert
  38.     (procedure expert_level
  39.         (
  40.             (user 2)
  41.         )
  42.     )
  43.  
  44. ; reset userlevel back to default
  45.     (procedure default_level
  46.         (
  47.             (user default-level)
  48.         )
  49.     )
  50.  
  51. ; store off userlevel
  52.     (procedure save_default_level
  53.         (
  54.             (set default-level @user-level)
  55.         )
  56.     )
  57.  
  58. ; some overused strings
  59. (set omp (cat "One moment please..." newline))
  60.  
  61. ; introduce ourselfs to the viewers
  62. (welcome "Welcome to the Thor installer.  This installer uses "
  63.     "the Commodore Amiga Installer.  All of our future Thor releases "
  64.     "will be using this installer and we would like to get any feedback "
  65.     "that might help to improve the installation procedure." newline
  66. )
  67. ; first reset the user level so that the novice can see whats going on
  68.     (save_default_level)
  69.     (expert_level)
  70.  
  71. ;Make assign to install from
  72.     (makeassign "Thor_Install" "" (safe))
  73.  
  74.  
  75. ;******************
  76. ;** Check Memory **
  77. ;******************
  78.  
  79. (run "Avail flush")
  80.  
  81. (set Running (run "Thor_Install:CheckForLib"))
  82.  
  83. (while (= Running 20)
  84.       (
  85.         (Message newline "Thor seem to be running, you MUST close it NOW."    
  86.                 newline "If you don't, the installation will fail!")
  87.         (run "Avail flush")
  88.         (set Running (run "Thor_Install:CheckForLib"))
  89.     )
  90. )
  91.  
  92. ;************************
  93. ;** Start Installation **
  94. ;************************
  95.  
  96. (if (exists "Thor:libs/bbsread.library" (noreq))
  97. ; Then
  98.     ((set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  99.     (abort end_text))
  100. )
  101.  
  102. (if (exists "BBSData:global.config" (noreq))
  103. ; Then
  104.     ((set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  105.     (abort end_text))
  106. )
  107.  
  108. (if (exists "envarc:THOR/BBSDataPath" (noreq))
  109. ; Then
  110.     ((set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  111.     (abort end_text))
  112. )
  113.  
  114. (if (exists "envarc:THOR/ThorPath" (noreq))
  115. ; Then
  116.     ((set end_text "Please use the UpdateThor script to\nupdate your already installed THOR.")
  117.     (abort end_text))
  118. )
  119.  
  120. (set Thor_Dir 
  121.     (askdir
  122.         (prompt "Where would you like Thor installed?"
  123.         newline "The installer will NOT create a directory!")
  124.         (help @askdir-help)
  125.         (default "Work:")
  126.         (newpath)
  127.     )
  128. )
  129. (set Thor_Dir (expandpath Thor_Dir))
  130.  
  131. ; before we go on lets reset the user's level back to what it was
  132. (default_level)
  133.  
  134. ; verify that the Thor directory exists
  135. (if (<> (exists Thor_Dir) is_a_dir)
  136.     (
  137.         (makedir Thor_Dir
  138.             (prompt
  139.                 "The directory you have selected for Thor does not "
  140.                 "seem to exist.  Do you want us to create it for you?"
  141.             )
  142.             (help @makedir-help)
  143.             (infos)
  144.             (confirm)
  145.         )
  146.     )
  147. )
  148.  
  149. ; Create directories for the THOR installation
  150.  
  151. (makeassign "Thor" Thor_dir)
  152. (makedir "Thor:Data")
  153. (makeassign "BBSData" "Thor:data")
  154.  
  155. ;***********************************
  156. ;***** GET FIRST DISK IN HERE ******
  157. ;***********************************
  158.  
  159. ; first copy over the stuff
  160. (working omp "Decompressing and copying Thor files.")
  161.  
  162. (run "Thor_Install:lhex -a -f -w=THOR: x Thor_Install:thor.lha" )
  163.  
  164. ;************************
  165. ;**  Copy the keyfile  **
  166. ;************************
  167. (if (exists "Thor_Install:THOR.key" (noreq))
  168. ; Then
  169.     (copyfiles
  170.         (source "Thor_Install:THOR.key")
  171.         (dest "THOR:")
  172.         (nogauge)
  173.     )
  174. )
  175.         
  176. ;*****************************************
  177. ;**  Copy the default arexx macro file  **
  178. ;*****************************************
  179. (if (exists "Thor_Install:THOR.macros" (noreq))
  180. ; Then
  181.     (copyfiles
  182.         (source "Thor_Install:THOR.macros")
  183.         (dest "THOR:")
  184.         (nogauge)
  185.     )
  186. )
  187.  
  188. (default_level)
  189.         
  190. ;***********************************
  191. ; Create the environment variables *
  192. ;***********************************
  193.  
  194. (set Running (run "Thor:bin/basemanager convert"))
  195. (if (<> 0 Running)
  196. (
  197.     ((set end_text "Basemanager failed in setting up the env-variables.")
  198.     (abort end_text)))
  199. )
  200.  
  201. ;**************************************
  202. ;* Install the bbsread database stuff *
  203. ;**************************************
  204.  
  205. (run "thor:bin/initarc")
  206. (run "thor:bin/InitCharsets")
  207.  
  208. (execute "thor:s/cfgqwk")
  209. (execute "thor:s/cfgfido")
  210. (execute "thor:s/cfgblue")
  211. (execute "thor:s/cfguqwk_soup")
  212. (execute "thor:s/cfguucp")
  213. (execute "thor:s/cfgsoup")
  214. (execute "thor:s/cfgabbs")
  215. (execute "thor:s/cfgabbs_qwk")
  216. (execute "thor:s/cfgmbbs")
  217. (execute "thor:s/cfgbbbs")
  218. (execute "thor:s/cfghippo")
  219. (execute "thor:s/cfgomen")
  220.  
  221.  
  222. ;******************
  223. ;** Locale stuff **
  224. ;******************
  225.  
  226. (default_level)
  227.  
  228. (set catalog
  229.    (askoptions
  230.       (prompt "What languages would you like to install ?\n"
  231.             "English is the built-in language.")
  232.       (help
  233.             "This will install locale files for other languages than English. "
  234.             "You can set the prefered language on Workbench and in Thor by"
  235.             "using the prefs:locale tool." newline @askchoice-help
  236.       )
  237.       (choices "Norsk")
  238.       (default 0)
  239.    )
  240. )
  241.  
  242. (if (<> 0 catalog)
  243.    (makedir "thor:catalogs")
  244. )
  245.  
  246. (if (bitand 1 catalog)
  247.     (copyfiles
  248.         (source "Thor_Install:catalogs/norsk")
  249.         (dest "thor:catalogs/norsk")
  250.         (all)
  251.     )
  252. )
  253.  
  254. ;*********************
  255. ;** reqtools.libary **
  256. ;*********************
  257.  
  258. (copylib
  259.     (prompt "Copying ReqTools library")
  260.     (help "This will copy the ReqTools library." newline @copylib-help)
  261.     (source "Thor_Install:reqtools.library")
  262.     (dest "libs:")
  263. )
  264.  
  265. ;***********
  266. ;** Fonts **
  267. ;***********
  268.     
  269. (copyfiles
  270.     (prompt "Choose the fonts to install with Thor" newline "These are not required for Thor to run" )
  271.     (help "This will copy the default font files for Thor." newline @copyfiles-help)
  272.     (source "Thor_Install:Fonts")
  273.     (dest "Fonts:")
  274.     (fonts)
  275.     (choices "Grn" "Thin609" "Thin611" "Thin711")
  276.     (confirm)
  277. )
  278.  
  279. ;****************
  280. ;** AmigaGuide **
  281. ;****************
  282.  
  283. (if    (askbool
  284.         (prompt newline "Do you want the AmigaGuide" newline "program and library installed?"
  285.             newline newline "If you have a newer version of the library" newline 
  286.             "on your system, it will NOT be overwritten")
  287.         (help newline "The AmigaGuide library is needed for the Thor documentation"
  288.             newline "and the online help system in Thor."
  289.             newline newline "Select YES if you want it installed, otherwise NO")
  290.         (default 1)
  291.     )
  292. ; Then
  293.     (
  294.         (copyfiles
  295.             (prompt "Copying AmigaGuide program file")
  296.             (help "This will copy the files needed by AmigaGuide." newline @copyfiles-help)
  297.             (source "Thor_Install:AmigaGuide")
  298.             (dest "sys:Utilities")
  299.         )
  300.         (copylib
  301.             (prompt "Copying AmigaGuide library")
  302.             (help "This will copy the AmigaGuide library." newline @copylib-help)
  303.             (source "Thor_Install:amigaguide.library")
  304.             (dest "libs:")
  305.         )
  306.     )
  307. )
  308. ;*****************************
  309. ;* Simple configuration here *
  310. ;*****************************
  311.  
  312. (if    (askbool
  313.     (
  314.         (prompt newline "The following section in this installation "
  315.                         "is used for setting up a download and an upload "
  316.                         "directory for message packets.  This section is "
  317.                         "optional, but the directories needs to be "
  318.                         "set in THOR if you do not set them up here.\n\n"
  319.                         "Do you want to proceed with this?")
  320.         (help newline "This section of the installation is dedicated "
  321.                         "to some first-time parameters that THOR "
  322.                         "needs to have configured.\n\n"
  323.                         "Select YES if you want to continue with this "
  324.                         "configuration, otherwise NO")
  325.         (default 1)
  326.         )
  327.     )
  328.     ; Then 
  329.     (
  330.         (set DL_Dir 
  331.                 (askdir
  332.                     (prompt "Where do you keep your downloaded message packets?\n\n"
  333.                             "This is usually the download directory "
  334.                             "configured in the communication program you "
  335.                             "use."
  336.                     (help @askdir-help)
  337.                     (default "Work:")
  338.                     (newpath)
  339.                 )
  340.             )
  341.         )
  342.         (set DL_Dir (expandpath DL_Dir))
  343.         
  344.         ; verify that the download directory exists
  345.         (if (<> (exists DL_Dir) is_a_dir)
  346.             (
  347.                 (makedir DL_Dir
  348.                     (prompt
  349.                         "The directory you have selected for downloaded "
  350.                         "message packets does not seem to exist.\n\n"
  351.                         "Do you want it to be created for you?")
  352.                     (help @makedir-help)
  353.                     (infos)
  354.                     (confirm)
  355.                 )
  356.             )
  357.         )
  358.         (if (= (exists DL_Dir) is_a_dir)
  359.             (
  360.                 (set dlstr (cat dlstr "sys:rexxc/rx THOR:rexx/cfgglobal.br DNL " quote DL_Dir quote))
  361.                 (run dlstr)
  362.                 (run dlstr)
  363.             )
  364.         )
  365.  
  366.         (set UL_Dir 
  367.                 (askdir
  368.                     (prompt "Where would you like to keep any reply "
  369.                             "message packets that THOR generates?\n\n"
  370.                             "This is usually the upload directory "
  371.                             "configured in your communication program."
  372.                     (help @askdir-help)
  373.                     (default "Work:")
  374.                     (newpath)
  375.                 )
  376.             )
  377.         )
  378.         (set UL_Dir (expandpath UL_Dir))
  379.         
  380.         ; verify that the download directory exists
  381.         (if (<> (exists UL_Dir) is_a_dir)
  382.             (
  383.                 (makedir UL_Dir
  384.                     (prompt
  385.                         "The directory you have selected for upload of "
  386.                         "reply packets does not seem to exist.\n\n"
  387.                         "Do you want it to be created for you?")
  388.                     (help @makedir-help)
  389.                     (infos)
  390.                     (confirm)
  391.                 )
  392.             )
  393.         )
  394.         (if (= (exists UL_Dir) is_a_dir)
  395.             (
  396.                 (set ulstr (cat ulstr "sys:rexxc/rx THOR:rexx/cfgglobal.br UPL " quote UL_Dir quote))
  397.                 (run ulstr)
  398.             )
  399.         )
  400.  
  401. ; Optionally configure a BBS.
  402.  
  403.         (if    (askbool
  404.             (
  405.                 (prompt newline "The following section in this installation "
  406.                                 "is used for setting up a System (BBS or "
  407.                                 "Internet provider.) "
  408.                                 "This can also be done later, in the Systems "
  409.                                 "Configuration in THOR.\n\n"
  410.                                 "Select YES to configure a System for use or NO "
  411.                                 "if you like to do this after the installation.")
  412.                 (help newline "This section of the installation is dedicated "
  413.                                 "to some first-time parameters that THOR "
  414.                                 "needs to have configured.\n\n"
  415.                                 "Select YES if you want to continue with this "
  416.                                 "configuration, otherwise NO")
  417.                 (default 1)
  418.                 )
  419.             )
  420.             ; Then
  421.             (
  422.                 (set bbs_type
  423.                    (askchoice
  424.                       (prompt "What type should this system be configured as?")
  425.                       (help
  426.                             "This option is for selecting which type of system this is. "
  427.                             "By setting a system type here, THOR knows what parser and "
  428.                             "packer to use on the message packets on this system.\n" @askchoice-help
  429.                       )
  430.  
  431.                       (choices    "QWK       - Normal QWK"
  432.                                 "Fido      - Normal Fidonet"
  433.                                 "BlueWave  - Normal BlueWave"
  434.                                 "SOUP      - Normal SOUP"
  435.                                 "UQWK_SOUP - SOUP with uqwk"
  436.                                 "UUCP      - Normal UUCP"
  437.                                 "ABBS      - Normal ABBS"
  438.                                 "ABBS_QWK  - ABBS with QWK support"
  439.                                 "MBBS      - Normal MBBS"
  440.                                 "Hippo     - Normal Hippo V2"
  441.                                 "BBBS      - Hippo on BBBS"
  442.                                 "Omen      - Normal Omen"
  443.                       )
  444.                       (default 0)
  445.                    )
  446.                 )
  447.  
  448.                 (if (= bbs_type 0)
  449.                     (set bbs_type "QWK")
  450.                 )
  451.                 (if (= bbs_type 1)
  452.                     (set bbs_type "Fido")
  453.                 )
  454.                 (if (= bbs_type 2)
  455.                     (set bbs_type "BlueWave")
  456.                 )
  457.                 (if (= bbs_type 3)
  458.                     (set bbs_type "SOUP")
  459.                 )
  460.                 (if (= bbs_type 4)
  461.                     (set bbs_type "UQWK_SOUP")
  462.                 )
  463.                 (if (= bbs_type 5)
  464.                     (set bbs_type "UUCP")
  465.                 )
  466.                 (if (= bbs_type 6)
  467.                     (set bbs_type "ABBS")
  468.                 )
  469.                 (if (= bbs_type 7)
  470.                     (set bbs_type "ABBS_QWK")
  471.                 )
  472.                 (if (= bbs_type 8)
  473.                     (set bbs_type "MBBS")
  474.                 )
  475.                 (if (= bbs_type 9)
  476.                     (set bbs_type "Hippo")
  477.                 )
  478.                 (if (= bbs_type 10)
  479.                     (set bbs_type "BBBS")
  480.                 )
  481.                 (if (= bbs_type 11)
  482.                     (set bbs_type "Omen")
  483.                 )
  484.                 (set BBS_Name
  485.                         (askstring
  486.                             (prompt "Please enter a name to use for the "
  487.                                     "System in THOR (e.g. 'Ultima Thule BBS')."
  488.                             (help @askstring-help)
  489.                         )
  490.                     )
  491.                 )
  492.                 (set Grab_Name
  493.                     (askstring
  494.                         (prompt "Please enter the name of message packets "
  495.                                 "from this System. Do not enter any "
  496.                                 "file extension, like .qwk or .lha. "
  497.                                 "(On UUCP systems, this should be the name "
  498.                                 "of your incoming mailbox.)")
  499.                         (help newline "If message packets are named e.g. 'thule134.qwk', " 
  500.                                         "just enter 'thule' here.\n"
  501.                         )
  502.                     )
  503.                 )
  504.                 (set str (cat str "sys:rexxc/rx THOR:rexx/cfgbbs.br " quote BBS_Name quote " GRAB " quote Grab_Name quote " TYPE " quote bbs_type quote))
  505.                 (run str)
  506.             )
  507.         )
  508.     )
  509. )
  510.  
  511. ;*****************************
  512. ;****** Install icons ********
  513. ;*****************************
  514.  
  515. (if    (askbool
  516.         (prompt newline "Do you want to install MagicWB " newline
  517.              "versions of the program and drawer icons?" newline)
  518.         (help newline "If you are using MagicWB on your Workbench, "
  519.             newline "you might want to install the special MagicWB icons."
  520.             newline newline "Select YES if you want it installed, otherwise NO")
  521.         (default 1)
  522.     )
  523. ; Then
  524.     (
  525.         (copyfiles
  526.             (prompt "Copying MagicWB icon files")
  527.             (source "Thor_Install:MWBIcons")
  528.             (dest "Thor:")
  529.             (pattern "~(THOR.guide.info)")
  530.             (nogauge)
  531.         )
  532.         (copyfiles
  533.             (prompt "Copying MagicWB icon files")
  534.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  535.             (dest "Thor:Docs")
  536.             (newname "THOR.guide.info")
  537.             (nogauge)
  538.         )
  539.         (copyfiles
  540.             (prompt "Copying MagicWB icon files")
  541.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  542.             (dest "Thor:Docs")
  543.             (newname "ConfigTHOR.guide.info")
  544.             (nogauge)
  545.         )
  546.         (copyfiles
  547.             (prompt "Copying MagicWB icon files")
  548.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  549.             (dest "Thor:Docs")
  550.             (newname "ARexx.guide.info")
  551.             (nogauge)
  552.         )
  553.         (copyfiles
  554.             (prompt "Copying MagicWB icon files")
  555.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  556.             (dest "Thor:Docs")
  557.             (newname "BBSReadRexx.guide.info")
  558.             (nogauge)
  559.         )
  560.         (copyfiles
  561.             (prompt "Copying MagicWB icon files")
  562.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  563.             (dest "Thor:Docs")
  564.             (newname "THOR_Rexx.guide.info")
  565.             (nogauge)
  566.         )
  567.         (copyfiles
  568.             (prompt "Copying MagicWB icon files")
  569.             (source "Thor_Install:MWBIcons/THOR.guide.info")
  570.             (dest "Thor:Docs")
  571.             (newname "Installation.guide.info")
  572.             (nogauge)
  573.         )
  574.     )
  575. )
  576.  
  577. (if (exists "env:sys/def_drawer.info" (noreq))
  578.     (copyfiles
  579.         (prompt "Copying default drawer icon")
  580.         (help "This will copy the default drawer icon." newline @copyfiles-help)
  581.         (source "env:sys/def_drawer.info")
  582.         (dest "Thor:")
  583.         (newname "Docs.info")
  584.         (infos)
  585.     )
  586. )
  587.  
  588.  
  589. ;*****************************
  590. ;***** WE ARE ALMOST DONE ****
  591. ;*****************************
  592.  
  593. ; make sure that default-dir is pointing to the right place
  594. (set @default-dest Thor_Dir)
  595.     
  596. (makeassign "Thor_Install")     
  597. ;(makeassign "Thor")
  598. (makeassign "BBSData")
  599. (makeassign "Thor_Disk" (safe))
  600.  
  601. ; final message for our viewers
  602.     (set end_text (cat "Hope you like THOR! Don't hesitate to "
  603.                     "send us comments, bugreports and suggestions."))
  604.  
  605. ; now for the exit
  606.     (exit end_text)
  607.  
  608.